package top.fzqblog.function

import java.util.*

/**
 * Created by 抽离 on 2017/8/2 0002.
 */

fun <T> asList(vararg ts: T): List<T> {
    val result = ArrayList<T>()
    for (t in ts)
        result.add(t)
    return result
}

fun main(args: Array<String>) {
    val list = asList(1,2)
    list.forEach(::println)

    System.out.println("完美的分割线：" + "------------------------------")

    val a = arrayOf(1, 2, 3)
    
    val list2 = asList(-1, 0, *a, 4)

    for (i in list2) {
        println(i)
    }

}